LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-25-2004, 02:14 PM   #1
wirawan0
Member
 
Registered: Aug 2003
Location: Virginia, USA
Distribution: Mandrake 9.1, SuSE 9.2, Ubuntu 7.04-10.04, Sabayon 5, Debian 6
Posts: 64

Rep: Reputation: 18
Question Activating case sensitivity in `sort' command?


Hi,
This may be a stupid question. I used Mandrake LInux 10. I tried to do `ls | sort', and here's what it gives:

Code:
~/logs/sync-wirawan0/wirawan0 $ (LC_ALL=C; LANG=C; ls |sort )
fsdiff-after-sync-20040623.txt
fsdiff-after-sync-20040623.txt~
MD5-BigVaults.diff-to-wp.diff
MD5-BigVaults.diff-to-wp.diff~
MD5-BigVaults.txt
MD5-Personal.txt
MD5-photos.txt
MD5-Projects.diff-to-wp.diff
MD5-Projects.diff-to-wp.diff~
MD5-Projects.txt
md5-unsorted
MD5-Work.diff-to-wp.diff
MD5-Work.diff-to-wp.diff~
MD5-Work.txt
TOC-BigVault.txt
TOC-Personal.txt
TOC-photos.before-sync.txt
TOC-photos.txt
TOC-Projects.txt
TOC-Work.txt
Why is the sorting order not CASE-SenSitiVE? It should have been case sensitive, because I didn't use the `-f' switch. Could someone help? This problem happens on my Mandrake box. It didn't happen with Redhat 9 box! I must have messed up somewhere. See that I've tried to fallback to "C" locale, if it may help.

Wirawan
 
Old 06-25-2004, 02:32 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Just a wild guess:

Is -f (--ignore-case) automatically aliassed?

alias sort could give an answer to that.
 
Old 06-25-2004, 05:10 PM   #3
wirawan0
Member
 
Registered: Aug 2003
Location: Virginia, USA
Distribution: Mandrake 9.1, SuSE 9.2, Ubuntu 7.04-10.04, Sabayon 5, Debian 6
Posts: 64

Original Poster
Rep: Reputation: 18
No, no. Of course not. I've checked that. :-)
 
Old 06-25-2004, 08:20 PM   #4
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
I don't want to either answer incorrectly or make a fool out of myself, so let me ask this first: Using the same example, how do you desire the results to look? -- J.W.
 
Old 06-26-2004, 10:20 AM   #5
wirawan0
Member
 
Registered: Aug 2003
Location: Virginia, USA
Distribution: Mandrake 9.1, SuSE 9.2, Ubuntu 7.04-10.04, Sabayon 5, Debian 6
Posts: 64

Original Poster
Rep: Reputation: 18
I think, if the case-sensitivity is correct, it should have been like this:

MD5-BigVaults.diff-to-wp.diff
MD5-BigVaults.diff-to-wp.diff~
MD5-BigVaults.txt
MD5-Personal.txt
MD5-Projects.diff-to-wp.diff
MD5-Projects.diff-to-wp.diff~
MD5-Projects.txt
MD5-Work.diff-to-wp.diff
MD5-Work.diff-to-wp.diff~
MD5-Work.txt
MD5-photos.txt
TOC-BigVault.txt
TOC-Personal.txt
TOC-Projects.txt
TOC-Work.txt
TOC-photos.before-sync.txt
TOC-photos.txt
fsdiff-after-sync-20040623.txt
fsdiff-after-sync-20040623.txt~
md5-unsorted

That is, it was sorted from A-Z, then a-z. Why? Since the character code of A-Z is lower (smaller) than a-z.

Last edited by wirawan0; 06-26-2004 at 10:22 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable case sensitivity in mysql query in Fedora Linux Core 3 radatan71 Linux - Software 1 10-28-2005 11:39 PM
Sort Command saravanan1979 Programming 1 10-03-2004 11:36 AM
Case-Sensitivity in Python Odd_Bloke Programming 2 09-02-2003 04:20 PM
Case sensitivity in SED substitutions jkoch Programming 1 02-21-2003 04:15 PM
Using the Sort command in vi timnphx Programming 2 04-06-2001 11:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration